extends PlayerState


func unhandled_input(event: InputEvent):
	if event.is_action_pressed("ui_select"):
		state_machine.transition_to(state_machine.STATE.ATTACK)
	

func physics_process(delta: float):
	player.physics_process(delta)


func process(delta: float):
	state_check()


func state_check():
	if abs(player.direction.x) > 0.01:
		state_machine.transition_to(state_machine.STATE.RUN)
	elif !player.is_on_floor():
		state_machine.transition_to(state_machine.STATE.JUMP_UP)


func enter(msg: Dictionary = {}):
	player.speed = player.run_speed
	player.jump_count = 0
	player.is_jump_double = false
	animation.play(state_machine.STATE.IDLE)
